<template>
  <div class="home-container">
    <!-- 头部横幅区域 -->
    <section class="hero-section">
      <!-- 背景图片层 -->
      <div class="hero-background" />

      <div class="hero-content">
        <div class="hero-badge">
          <i class="fas fa-star" />
          <span>专业博客平台</span>
        </div>
        <h1 :data-text="WEBSITE_NAME">
          {{ WEBSITE_NAME }}
        </h1>
        <p class="subtitle">
          {{ WEBSITE_INTRODUCTION }}
        </p>

        <!-- 特色标签 -->
        <div class="feature-tags">
          <span class="tag">
            <i class="fas fa-code" />
            技术分享
          </span>
          <span class="tag">
            <i class="fas fa-users" />
            社区互动
          </span>
          <span class="tag">
            <i class="fas fa-mobile-alt" />
            响应式设计
          </span>
        </div>

        <div class="hero-buttons">
          <button class="primary-btn">
            <i class="fas fa-pen-fancy" />
            开始创作
          </button>
          <button class="secondary-btn">
            <i class="fas fa-info-circle" />
            了解更多
          </button>
        </div>
      </div>
    </section>

    <!-- 网站信息概览区域 -->
    <section class="website-overview" style="animation: fadeInUp 0.8s ease-out">
      <div class="overview-container">
        <!-- 左侧统计卡片区域 -->
        <div class="stats-section">
          <h2 class="section-title">网站统计</h2>
          <div class="overview-grid">
            <!-- 文章统计 -->
            <div class="overview-card" style="animation: fadeInUp 0.6s ease-out 0.1s both">
              <div class="overview-icon">
                <i class="fas fa-file-alt" />
              </div>
              <div class="overview-content">
                <h3>{{ totalArticles }}</h3>
                <p>总文章数</p>
              </div>
            </div>

            <!-- 分类统计 -->
            <div class="overview-card" style="animation: fadeInUp 0.6s ease-out 0.2s both">
              <div class="overview-icon">
                <i class="fas fa-folder" />
              </div>
              <div class="overview-content">
                <h3>{{ categories.length }}</h3>
                <p>文章分类</p>
              </div>
            </div>

            <!-- 阅读统计 -->
            <div class="overview-card" style="animation: fadeInUp 0.6s ease-out 0.3s both">
              <div class="overview-icon">
                <i class="fas fa-eye" />
              </div>
              <div class="overview-content">
                <h3>{{ totalViews }}</h3>
                <p>总阅读量</p>
              </div>
            </div>

            <!-- 评论统计 -->
            <div class="overview-card" style="animation: fadeInUp 0.6s ease-out 0.4s both">
              <div class="overview-icon">
                <i class="fas fa-comments" />
              </div>
              <div class="overview-content">
                <h3>{{ totalComments }}</h3>
                <p>总评论数</p>
              </div>
            </div>

            <!-- 点赞统计 -->
            <div class="overview-card" style="animation: fadeInUp 0.6s ease-out 0.5s both">
              <div class="overview-icon">
                <i class="fas fa-heart" />
              </div>
              <div class="overview-content">
                <h3>{{ totalLikes }}</h3>
                <p>总点赞数</p>
              </div>
            </div>

            <!-- 用户统计 -->
            <div class="overview-card" style="animation: fadeInUp 0.6s ease-out 0.6s both">
              <div class="overview-icon">
                <i class="fas fa-users" />
              </div>
              <div class="overview-content">
                <h3>{{ totalUsers }}</h3>
                <p>注册用户</p>
              </div>
            </div>
          </div>
        </div>

        <!-- 右侧有用信息区域 -->
        <div class="info-section">
          <!-- 快速导航 -->
          <div class="info-card quick-nav" style="animation: fadeInUp 0.6s ease-out 0.5s both">
            <h3 class="info-title">
              <i class="fas fa-compass" />
              快速导航
            </h3>
            <div class="nav-links">
              <a href="/blogList" class="nav-link">
                <i class="fas fa-list" />
                <span>文章列表</span>
              </a>
              <a href="/specialColumn" class="nav-link">
                <i class="fas fa-columns" />
                <span>专栏</span>
              </a>
              <a href="/wall" class="nav-link">
                <i class="fas fa-comments" />
                <span>留言墙</span>
              </a>
              <a href="/author" class="nav-link">
                <i class="fas fa-user" />
                <span>关于作者</span>
              </a>
            </div>
          </div>

          <!-- 热门标签 -->
          <div class="info-card hot-tags" style="animation: fadeInUp 0.6s ease-out 0.6s both">
            <h3 class="info-title">
              <i class="fas fa-tags" />
              热门标签
            </h3>
            <div class="tags-container">
              <span v-for="(category, index) in categories.slice(0, 6)" :key="index" class="tag">
                {{ category.categoryName }}
              </span>
            </div>
          </div>

          <!-- 网站状态 -->
          <div class="info-card site-status" style="animation: fadeInUp 0.6s ease-out 0.7s both">
            <h3 class="info-title">
              <i class="fas fa-heartbeat" />
              网站状态
            </h3>
            <div class="status-items">
              <div class="status-item">
                <span class="status-label">运行时间</span>
                <span class="status-value">{{ getUptime() }}</span>
              </div>
              <div class="status-item">
                <span class="status-label">今日访问</span>
                <span class="status-value">{{ todayViews || '0' }}</span>
              </div>
              <div class="status-item">
                <span class="status-label">在线用户</span>
                <span class="status-value online">●</span>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>

    <!-- 最新文章区域 -->
    <section class="latest-posts">
      <div class="section-header">
        <h2>
          <i class="fas fa-newspaper" />
          发现最新的技术分享和精彩内容
        </h2>
        <a href="/blogList" class="view-all-btn">
          查看全部
          <i class="fas fa-arrow-right" />
        </a>
      </div>

      <div class="posts-grid">
        <div
          v-for="(post, index) in latestPosts"
          :key="post.blogId"
          class="post-card"
          :style="`animation: fadeInUp 0.6s ease-out ${0.1 * index}s both;`"
        >
          <div
            class="post-image"
            :style="{
              backgroundImage: `url(${post.blogCoverImage || defaultCover})`
            }"
          >
            <div class="post-overlay">
              <div class="post-actions">
                <button class="action-btn" title="阅读文章">
                  <i class="fas fa-eye" />
                </button>
                <button class="action-btn" title="收藏文章">
                  <i class="fas fa-bookmark" />
                </button>
                <button class="action-btn" title="分享文章">
                  <i class="fas fa-share" />
                </button>
              </div>
            </div>
            <div class="post-badge">
              <i class="fas fa-fire" />
              热门
            </div>
          </div>
          <div class="post-content">
            <div class="post-category">
              <i class="fas fa-folder" />
              <span>技术分享</span>
            </div>
            <h3>{{ post.blogTitle }}</h3>
            <p>{{ cleanTextContent(post.blogContent || '') }}</p>
            <div class="post-meta">
              <div class="meta-item">
                <i class="fas fa-calendar" />
                <span>{{ post.createTime }}</span>
              </div>
              <div class="meta-item">
                <i class="fas fa-eye" />
                <span>{{ post.blogViews }}</span>
              </div>
              <div class="meta-item">
                <i class="fas fa-comments" />
                <span>{{ Math.floor(Math.random() * 50) + 5 }}</span>
              </div>
              <div class="meta-item">
                <i class="fas fa-heart" />
                <span>{{ Math.floor(Math.random() * 100) + 10 }}</span>
              </div>
            </div>
            <div class="post-tags">
              <span class="tag">Vue.js</span>
              <span class="tag">前端</span>
              <span class="tag">教程</span>
            </div>
          </div>
        </div>
      </div>

      <!-- 文章推荐 -->
      <div class="recommended-posts">
        <h3>
          <i class="fas fa-thumbs-up" />
          推荐阅读
        </h3>
        <div class="recommended-grid">
          <div v-for="(post, index) in recommendedPosts" :key="index" class="recommended-card">
            <div class="recommended-image" :style="{ backgroundImage: `url(${post.image})` }" />
            <div class="recommended-content">
              <h4>{{ post.title }}</h4>
              <div class="recommended-meta">
                <span>{{ post.views }} 阅读</span>
                <span>{{ post.date }}</span>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>

    <!-- 热门文章区域 -->
    <section class="popular-posts" style="animation: fadeInUp 0.8s ease-out 0.4s both">
      <h2>热门文章</h2>
      <div class="popular-grid">
        <div
          v-for="(post, index) in popularPosts"
          :key="post.blogId"
          class="popular-card"
          :style="{ animation: `fadeInUp 0.6s ease-out ${index * 0.1}s both` }"
        >
          <div class="post-rank">
            {{ popularPosts.indexOf(post) + 1 }}
          </div>
          <div class="post-info">
            <h3>{{ post.blogTitle }}</h3>
            <p>{{ cleanTextContent(post.blogContent || '') }}</p>
            <div class="post-stats">
              <span>
                <i class="fas fa-eye" />
                {{ post.blogViews }}
              </span>
              <span>
                <i class="fas fa-comments" />
                {{ post.commentCount || 0 }}
              </span>
              <span>
                <i class="fas fa-heart" />
                {{ post.likeCount || 0 }}
              </span>
            </div>
          </div>
        </div>
      </div>
    </section>

    <!-- 特色功能区域 -->
    <section class="feature-section" style="animation: fadeInUp 0.8s ease-out 0.2s both">
      <div class="section-header">
        <h2>
          <i class="fas fa-star" />
          为什么选择我们的博客平台？
        </h2>
      </div>

      <div class="feature-grid">
        <div class="feature-card" style="animation: fadeInUp 0.6s ease-out 0.3s both">
          <div class="feature-icon">
            <i class="fas fa-pen-fancy" />
          </div>
          <h3>优质内容</h3>
          <p>精心撰写的技术文章，涵盖前端开发、后端技术、DevOps等多个领域</p>
          <div class="feature-stats">
            <span class="stat">
              <i class="fas fa-file-alt" />
              {{ totalArticles }}+ 文章
            </span>
            <span class="stat">
              <i class="fas fa-eye" />
              {{ totalViews.toLocaleString() }}+ 阅读
            </span>
          </div>
        </div>

        <div class="feature-card" style="animation: fadeInUp 0.6s ease-out 0.4s both">
          <div class="feature-icon">
            <i class="fas fa-code" />
          </div>
          <h3>代码示例</h3>
          <p>每篇文章都配有完整的代码示例，便于学习和实践</p>
          <div class="feature-stats">
            <span class="stat">
              <i class="fas fa-code-branch" />
              100% 可运行
            </span>
            <span class="stat">
              <i class="fas fa-download" />
              一键复制
            </span>
          </div>
        </div>

        <div class="feature-card" style="animation: fadeInUp 0.6s ease-out 0.5s both">
          <div class="feature-icon">
            <i class="fas fa-comments" />
          </div>
          <h3>互动交流</h3>
          <p>支持评论和讨论，与读者建立良好的技术交流社区</p>
          <div class="feature-stats">
            <span class="stat">
              <i class="fas fa-comments" />
              {{ totalComments }}+ 评论
            </span>
            <span class="stat">
              <i class="fas fa-users" />
              {{ totalUsers }}+ 用户
            </span>
          </div>
        </div>

        <div class="feature-card" style="animation: fadeInUp 0.6s ease-out 0.6s both">
          <div class="feature-icon">
            <i class="fas fa-mobile-alt" />
          </div>
          <h3>响应式设计</h3>
          <p>完美适配各种设备，随时随地阅读和学习</p>
          <div class="feature-stats">
            <span class="stat">
              <i class="fas fa-mobile-alt" />
              移动优先
            </span>
            <span class="stat">
              <i class="fas fa-tachometer-alt" />
              极速加载
            </span>
          </div>
        </div>
      </div>
    </section>

    <!-- 技术栈展示区域 -->
    <section class="tech-stack" style="animation: fadeInUp 0.8s ease-out 0.6s both">
      <div class="section-header">
        <h2>
          <i class="fas fa-code" />
          基于现代化技术栈构建，提供卓越的用户体验
        </h2>
      </div>

      <div class="tech-grid">
        <div class="tech-card" style="animation: fadeInUp 0.6s ease-out 0.7s both">
          <div class="tech-logo">
            <img src="/static/logo/vue-logo.png" alt="Vue.js" />
            <div class="tech-badge">核心</div>
          </div>
          <h3>Vue 3</h3>
          <p>现代化的前端框架，提供响应式和组件化开发体验</p>
          <div class="tech-features">
            <span class="feature-tag">Composition API</span>
            <span class="feature-tag">TypeScript</span>
            <span class="feature-tag">响应式</span>
          </div>
          <div class="tech-stats">
            <span class="stat">
              <i class="fas fa-download" />
              200M+ 下载
            </span>
          </div>
        </div>

        <div class="tech-card" style="animation: fadeInUp 0.6s ease-out 0.8s both">
          <div class="tech-logo">
            <img src="/static/logo/ts-logo.png" alt="TypeScript" />
            <div class="tech-badge">类型安全</div>
          </div>
          <h3>TypeScript</h3>
          <p>类型安全的JavaScript超集，提高代码质量和开发效率</p>
          <div class="tech-features">
            <span class="feature-tag">类型检查</span>
            <span class="feature-tag">智能提示</span>
            <span class="feature-tag">重构安全</span>
          </div>
          <div class="tech-stats">
            <span class="stat">
              <i class="fas fa-shield-alt" />
              100% 类型覆盖
            </span>
          </div>
        </div>

        <div class="tech-card" style="animation: fadeInUp 0.6s ease-out 0.9s both">
          <div class="tech-logo">
            <img src="/static/logo/vite-logo.svg" alt="Vite" />
            <div class="tech-badge">极速</div>
          </div>
          <h3>Vite</h3>
          <p>下一代前端构建工具，提供极速的热更新和构建体验</p>
          <div class="tech-features">
            <span class="feature-tag">ESM</span>
            <span class="feature-tag">HMR</span>
            <span class="feature-tag">Rollup</span>
          </div>
          <div class="tech-stats">
            <span class="stat">
              <i class="fas fa-tachometer-alt" />
              &lt; 1s 启动
            </span>
          </div>
        </div>

        <div class="tech-card" style="animation: fadeInUp 0.6s ease-out 1s both">
          <div class="tech-logo">
            <img src="/static/logo/element-plus-logo.svg" alt="Element Plus" />
            <div class="tech-badge">UI库</div>
          </div>
          <h3>Element Plus</h3>
          <p>基于Vue 3的组件库，提供丰富的UI组件和交互体验</p>
          <div class="tech-features">
            <span class="feature-tag">组件丰富</span>
            <span class="feature-tag">主题定制</span>
            <span class="feature-tag">无障碍</span>
          </div>
          <div class="tech-stats">
            <span class="stat">
              <i class="fas fa-puzzle-piece" />
              80+ 组件
            </span>
          </div>
        </div>
      </div>
    </section>

    <!-- 页脚区域 -->
    <footer class="site-footer">
      <div class="footer-content">
        <!-- 左侧：网站信息 -->
        <div class="footer-section">
          <h3>{{ WEBSITE_NAME }}</h3>
          <p class="footer-description">
            {{ WEBSITE_INTRODUCTION }}
          </p>
          <div class="footer-social">
            <a
              v-for="link in socialLinks"
              :key="link.platform"
              :href="link.url"
              :title="link.platform"
              class="social-icon"
            >
              <i :class="link.icon" />
            </a>
          </div>
        </div>

        <!-- 中间：快速链接 -->
        <div class="footer-section">
          <h3>快速链接</h3>
          <ul class="footer-links">
            <li><a href="/">首页</a></li>
            <li><a href="/archive">文章归档</a></li>
            <li><a href="/categories">分类专栏</a></li>
            <li><a href="/about">关于我</a></li>
            <li><a href="/friends">友情链接</a></li>
          </ul>
        </div>

        <!-- 右侧：联系方式 -->
        <div class="footer-section">
          <h3>联系我</h3>
          <ul class="contact-info">
            <li>
              <i class="fab fa-gitee" />
              <a href="https://gitee.com/banyunjian" target="_blank" rel="noopener">Gitee</a>
            </li>
            <li>
              <i class="fas fa-rss" />
              <a href="/rss.xml">RSS 订阅</a>
            </li>
          </ul>
        </div>
      </div>
    </footer>
  </div>
</template>

<script setup lang="ts">
import { getLatestBlog } from '@/api/blog';
import type { BlogInfo } from '@/api/blog/types';
import { getCategoryStatistics } from '@/api/category';
import type { BlogCategoryStatisticsVO } from '@/api/category/types';
import { WEBSITE_INTRODUCTION, WEBSITE_NAME } from '@/constants';
import { useCommonStore } from '@/store/modules/common';
import { useUserStore } from '@/store/modules/user';
import { cleanTextContent } from '@/utils';
import { computed, onBeforeUnmount, onMounted, ref } from 'vue';

const UserStore = useUserStore();
// 用户信息
const userInfo = computed(() => UserStore.userInfo);
// 最新文章列表
const latestPosts = ref<BlogInfo[]>([]);
const defaultCover = '/path/to/default-cover.jpg'; // 设置一个默认封面图片

// 获取最新文章
const fetchLatestPosts = async () => {
  try {
    const response = await getLatestBlog();
    if (response.data) {
      latestPosts.value = Array.isArray(response.data) ? response.data : [response.data];
    }
  } catch (error) {
    console.error('获取最新文章失败:', error);
  }
};

// 获取分类统计
const categories = ref<BlogCategoryStatisticsVO[]>([]);
const getCategoryStatistic = () => {
  getCategoryStatistics().then(response => {
    categories.value = response.data as [];
  });
};

const CommonStore = useCommonStore();

const getDictionary = async () => {
  await CommonStore.getDictionary();
};

onMounted(() => {
  fetchLatestPosts();
  getCategoryStatistic();
  getDictionary();
});

onBeforeUnmount(() => {
  // 清理工作
});

const socialLinks = ref([
  {
    platform: 'GitHub',
    url: 'https://github.com/',
    icon: 'fab fa-github'
  },
  {
    platform: 'Twitter',
    url: 'https://twitter.com/',
    icon: 'fab fa-twitter'
  }
  // 添加更多社交链接...
]);

// 网站统计数据
const totalArticles = ref(128);
const totalViews = ref(45678);
const totalComments = ref(2345);
const totalLikes = ref(5678);
const totalUsers = ref(1234);
const todayViews = ref(156);

// 网站运行时间计算
const getUptime = () => {
  const startDate = new Date('2024-01-01'); // 网站开始运行的时间
  const now = new Date();
  const diffTime = Math.abs(now.getTime() - startDate.getTime());
  const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));

  if (diffDays < 30) {
    return `${diffDays}天`;
  } else if (diffDays < 365) {
    const months = Math.floor(diffDays / 30);
    return `${months}个月`;
  } else {
    const years = Math.floor(diffDays / 365);
    const months = Math.floor((diffDays % 365) / 30);
    return months > 0 ? `${years}年${months}个月` : `${years}年`;
  }
};

// 热门文章数据
const popularPosts = ref([
  {
    blogId: 1,
    blogTitle: 'Vue 3 Composition API 最佳实践',
    blogContent: '深入探讨Vue 3 Composition API的使用技巧和最佳实践...',
    blogViews: 1234,
    commentCount: 56,
    likeCount: 89
  },
  {
    blogId: 2,
    blogTitle: 'TypeScript在大型项目中的应用',
    blogContent: '分享在大型前端项目中TypeScript的类型设计和架构经验...',
    blogViews: 987,
    commentCount: 34,
    likeCount: 67
  },
  {
    blogId: 3,
    blogTitle: '前端性能优化实战指南',
    blogContent: '从加载速度到运行时性能，全面解析前端性能优化策略...',
    blogViews: 876,
    commentCount: 23,
    likeCount: 45
  }
]);

// 推荐文章数据
const recommendedPosts = ref([
  {
    title: 'Vue 3 响应式原理深度解析',
    image: '/static/img/tech1.jpg',
    views: 2345,
    date: '2024-01-15'
  },
  {
    title: 'TypeScript 高级类型技巧',
    image: '/static/img/tech2.jpg',
    views: 1876,
    date: '2024-01-12'
  },
  {
    title: '前端工程化最佳实践',
    image: '/static/img/tech3.jpg',
    views: 1567,
    date: '2024-01-10'
  },
  {
    title: 'CSS Grid 布局完全指南',
    image: '/static/img/tech4.jpg',
    views: 1234,
    date: '2024-01-08'
  }
]);
</script>

<style scoped lang="scss">
.home-container {
  width: 100%;
  min-height: 100vh;
  background-color: #ffffff;

  .hero-section {
    position: relative;
    height: 50vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

    .hero-background {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-image: url('/static/img/home_bgi.jpg');
      background-size: cover;
      background-position: center;
      opacity: 0.3;
      z-index: 1;
    }

    .hero-content {
      position: relative;
      z-index: 3;
      width: 100%;
      text-align: center;
      padding: 2rem;

      .hero-badge {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(10px);
        padding: 0.5rem 1rem;
        border-radius: 20px;
        border: 1px solid rgba(255, 255, 255, 0.3);
        margin-bottom: 1.5rem;
        font-size: 0.9rem;
        color: white;
        font-weight: 500;
        animation: fadeIn 1s ease-out 0.2s both;

        i {
          color: #ffd700;
        }
      }

      .feature-tags {
        display: flex;
        justify-content: center;
        gap: 1rem;
        margin-bottom: 2rem;
        flex-wrap: wrap;
        animation: fadeIn 1s ease-out 0.4s both;

        .tag {
          display: flex;
          align-items: center;
          gap: 0.5rem;
          background: rgba(255, 255, 255, 0.15);
          backdrop-filter: blur(10px);
          padding: 0.5rem 1rem;
          border-radius: 20px;
          border: 1px solid rgba(255, 255, 255, 0.2);
          color: white;
          font-size: 0.9rem;
          font-weight: 500;
          transition: all 0.3s ease;

          &:hover {
            background: rgba(255, 255, 255, 0.25);
            transform: translateY(-2px);
          }

          i {
            font-size: 0.8rem;
          }
        }
      }

      .hero-preview {
        display: flex;
        justify-content: center;
        gap: 2rem;
        flex-wrap: wrap;
        animation: fadeIn 1s ease-out 0.8s both;

        .preview-item {
          display: flex;
          align-items: center;
          gap: 0.5rem;
          color: rgba(255, 255, 255, 0.8);
          font-size: 0.9rem;
          font-weight: 500;

          i {
            color: #ffd700;
          }
        }
      }

      h1 {
        font-size: 4rem;
        margin-bottom: 1rem;
        font-weight: bold;
        letter-spacing: 2px;
        position: relative;
        color: white;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        animation: fadeIn 1s ease-out 0.1s both;

        &::before {
          content: attr(data-text);
          position: absolute;
          left: 0;
          top: 0;
          width: 100%;
          height: 100%;
          background: linear-gradient(45deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.3));
          -webkit-background-clip: text;
          background-clip: text;
          -webkit-text-fill-color: transparent;
          z-index: -1;
          filter: blur(8px);
          opacity: 0.5;
        }
      }

      .subtitle {
        font-size: 1.5rem;
        margin-bottom: 2rem;
        color: rgba(255, 255, 255, 0.9);
        animation: fadeIn 1s ease-out 0.3s both;
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
        line-height: 1.6;
      }

      .hero-buttons {
        display: flex;
        gap: 1rem;
        justify-content: center;
        flex-wrap: wrap;
        margin-bottom: 2rem;
        animation: fadeIn 1s ease-out 0.6s both;

        .primary-btn,
        .secondary-btn {
          padding: 1rem 2rem;
          border: none;
          border-radius: 50px;
          font-size: 1.1rem;
          font-weight: 600;
          cursor: pointer;
          transition: all 0.3s ease;
          text-decoration: none;
          display: inline-flex;
          align-items: center;
          gap: 0.5rem;
          position: relative;
          overflow: hidden;

          &::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.3), transparent);
            transition: 0.5s;
          }

          &:hover {
            transform: translateY(-3px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);

            &::before {
              left: 100%;
            }
          }
        }

        .primary-btn {
          background: linear-gradient(45deg, #764ba2, #667eea);
          color: white;
          border: none;

          &:hover {
            background: linear-gradient(45deg, #667eea, #764ba2);
          }
        }

        .secondary-btn {
          background: rgba(255, 255, 255, 0.1);
          color: #764ba2;
          border: 2px solid #764ba2;
          backdrop-filter: blur(5px);

          &:hover {
            background: rgba(118, 75, 162, 0.1);
            border-color: #667eea;
            color: #667eea;
          }
        }
      }
    }
  }

  section {
    background: white;
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 2rem auto;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }

  .latest-posts {
    background: white;
    border-radius: 20px;
    padding: 4rem 2rem;
    margin: 2rem auto;
    max-width: 1200px;
    box-shadow:
      0 4px 6px -1px rgba(0, 0, 0, 0.05),
      0 2px 4px -1px rgba(0, 0, 0, 0.03);

    .section-header {
      text-align: center;
      margin-bottom: 3rem;

      h2 {
        font-size: 2.5rem;
        color: #2c3e50;
        margin-bottom: 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 1rem;

        i {
          color: #3b82f6;
        }
      }

      .section-subtitle {
        font-size: 1.1rem;
        color: #64748b;
        margin-bottom: 2rem;
      }

      .view-all-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        background: linear-gradient(45deg, #3b82f6, #8b5cf6);
        color: white;
        padding: 0.8rem 1.5rem;
        border-radius: 25px;
        text-decoration: none;
        font-weight: 500;
        transition: all 0.3s ease;

        &:hover {
          transform: translateY(-2px);
          box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
        }
      }
    }

    .recommended-posts {
      margin-top: 3rem;
      padding-top: 2rem;
      border-top: 1px solid #e2e8f0;

      h3 {
        font-size: 1.5rem;
        color: #2c3e50;
        margin-bottom: 1.5rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;

        i {
          color: #10b981;
        }
      }

      .recommended-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;

        .recommended-card {
          display: flex;
          gap: 1rem;
          padding: 1rem;
          background: #f8fafc;
          border-radius: 8px;
          transition: all 0.3s ease;

          &:hover {
            background: white;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            transform: translateY(-2px);
          }

          .recommended-image {
            width: 60px;
            height: 60px;
            border-radius: 6px;
            background-size: cover;
            background-position: center;
            flex-shrink: 0;
          }

          .recommended-content {
            flex: 1;

            h4 {
              font-size: 0.9rem;
              color: #2c3e50;
              margin-bottom: 0.5rem;
              line-height: 1.4;
            }

            .recommended-meta {
              display: flex;
              gap: 1rem;
              font-size: 0.8rem;
              color: #64748b;
            }
          }
        }
      }
    }
  }

  .posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;

    .post-card {
      background: white;
      border-radius: 12px;
      overflow: hidden;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
      transition: all 0.3s ease;
      border: 1px solid #e2e8f0;

      &:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
      }

      .post-image {
        height: 200px;
        background-size: cover;
        background-position: center;
        position: relative;

        .post-overlay {
          position: absolute;
          top: 0;
          left: 0;
          right: 0;
          bottom: 0;
          background: rgba(0, 0, 0, 0.5);
          display: flex;
          align-items: center;
          justify-content: center;
          opacity: 0;
          transition: opacity 0.3s ease;

          .post-actions {
            display: flex;
            gap: 1rem;

            .action-btn {
              width: 40px;
              height: 40px;
              border-radius: 50%;
              background: rgba(255, 255, 255, 0.9);
              border: none;
              display: flex;
              align-items: center;
              justify-content: center;
              cursor: pointer;
              transition: all 0.3s ease;
              color: #374151;

              &:hover {
                background: white;
                transform: scale(1.1);
                color: #3b82f6;
              }
            }
          }
        }

        .post-badge {
          position: absolute;
          top: 1rem;
          right: 1rem;
          background: linear-gradient(45deg, #ff6b6b, #ee5a24);
          color: white;
          padding: 0.3rem 0.8rem;
          border-radius: 15px;
          font-size: 0.8rem;
          font-weight: 500;
          display: flex;
          align-items: center;
          gap: 0.3rem;
        }

        &:hover .post-overlay {
          opacity: 1;
        }
      }

      .post-content {
        padding: 1.5rem;

        .post-category {
          display: flex;
          align-items: center;
          gap: 0.5rem;
          color: #3b82f6;
          font-size: 0.8rem;
          font-weight: 500;
          margin-bottom: 0.8rem;

          i {
            font-size: 0.7rem;
          }
        }

        h3 {
          font-size: 1.3rem;
          color: #2c3e50;
          margin-bottom: 1rem;
          line-height: 1.4;
        }

        p {
          color: #64748b;
          line-height: 1.6;
          margin-bottom: 1.5rem;
          font-size: 0.9rem;
          display: -webkit-box;
          -webkit-box-orient: vertical;
          -webkit-line-clamp: 3;
          overflow: hidden;
        }

        .post-meta {
          display: flex;
          gap: 1rem;
          margin-bottom: 1rem;
          flex-wrap: wrap;

          .meta-item {
            display: flex;
            align-items: center;
            gap: 0.3rem;
            color: #64748b;
            font-size: 0.8rem;

            i {
              font-size: 0.7rem;
              color: #94a3b8;
            }
          }
        }

        .post-tags {
          display: flex;
          gap: 0.5rem;
          flex-wrap: wrap;

          .tag {
            padding: 0.2rem 0.6rem;
            background: #f1f5f9;
            color: #475569;
            border-radius: 12px;
            font-size: 0.7rem;
            font-weight: 500;
            transition: all 0.2s ease;

            &:hover {
              background: #e2e8f0;
              color: #334155;
            }
          }
        }
      }
    }
  }

  .popular-posts,
  .tech-stack {
    h2 {
      text-align: center;
      margin-bottom: 3rem;
      font-size: 2.5rem;
      color: #2c3e50;
    }
  }

  .popular-posts {
    background: white;
    border-radius: 20px;
    padding: 4rem 2rem;
    margin: 2rem auto;
    max-width: 1200px;

    .popular-grid {
      display: grid;
      gap: 1.5rem;

      .popular-card {
        display: flex;
        align-items: center;
        padding: 1.5rem;
        background: #f8f9fa;
        border-radius: 12px;
        transition: all 0.3s ease;

        &:hover {
          transform: translateX(5px);
          box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
          background: white;
        }

        .post-rank {
          width: 40px;
          height: 40px;
          display: flex;
          align-items: center;
          justify-content: center;
          background: linear-gradient(45deg, #667eea, #764ba2);
          color: white;
          font-weight: bold;
          border-radius: 50%;
          margin-right: 1.5rem;
          font-size: 1.2rem;
        }

        .post-info {
          flex: 1;

          h3 {
            font-size: 1.2rem;
            color: #2c3e50;
            margin-bottom: 0.5rem;
          }

          p {
            color: #666;
            line-height: 1.5;
            margin-bottom: 1rem;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
          }

          .post-stats {
            display: flex;
            gap: 1rem;
            font-size: 0.9rem;
            color: #999;

            span {
              display: flex;
              align-items: center;
              gap: 0.3rem;

              i {
                font-size: 0.8rem;
              }
            }
          }
        }
      }
    }
  }

  .tech-stack {
    .tech-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
      gap: 2rem;

      .tech-card {
        text-align: center;
        padding: 2rem 1.5rem;
        border-radius: 15px;
        background: #f8f9fa;
        transition: all 0.3s ease;

        &:hover {
          transform: translateY(-5px);
          box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
          background: white;
        }

        img {
          width: 80px;
          height: 80px;
          object-fit: contain;
          margin-bottom: 1.5rem;
        }

        h3 {
          font-size: 1.3rem;
          color: #2c3e50;
          margin-bottom: 1rem;
        }

        p {
          color: #666;
          line-height: 1.6;
          font-size: 0.95rem;
        }
      }
    }
  }

  .website-overview {
    background: linear-gradient(
      135deg,
      rgba(248, 250, 252, 0.95) 0%,
      rgba(241, 245, 249, 0.95) 100%
    );
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 1200px;
    box-shadow:
      0 4px 6px -1px rgba(0, 0, 0, 0.05),
      0 2px 4px -1px rgba(0, 0, 0, 0.03);
    backdrop-filter: blur(8px);

    .overview-container {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 2rem;
      align-items: start;
    }

    .stats-section {
      .section-title {
        font-size: 1.25rem;
        font-weight: 600;
        color: #1e293b;
        margin-bottom: 1.5rem;
        text-align: center;
      }

      .overview-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;

        .overview-card {
          text-align: center;
          padding: 1.2rem 0.8rem;
          background: rgba(255, 255, 255, 0.7);
          border: 1px solid rgba(226, 232, 240, 0.6);
          border-radius: 8px;
          transition: all 0.2s ease;
          position: relative;
          overflow: hidden;

          &::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 2px;
            background: linear-gradient(90deg, #3b82f6, #8b5cf6, #06b6d4);
            opacity: 0;
            transition: opacity 0.2s ease;
          }

          &:hover {
            transform: translateY(-2px);
            background: rgba(255, 255, 255, 0.9);
            border-color: rgba(59, 130, 246, 0.3);
            box-shadow: 0 6px 20px -5px rgba(0, 0, 0, 0.1);

            &::before {
              opacity: 1;
            }
          }

          .overview-icon {
            font-size: 1.8rem;
            margin-bottom: 0.8rem;
            color: #64748b;
            transition: color 0.2s ease;
          }

          &:hover .overview-icon {
            color: #3b82f6;
          }

          .overview-content {
            h3 {
              font-size: 1.5rem;
              font-weight: 600;
              margin-bottom: 0.3rem;
              color: #1e293b;
              letter-spacing: -0.025em;
            }

            p {
              color: #64748b;
              font-size: 0.75rem;
              font-weight: 500;
              text-transform: uppercase;
              letter-spacing: 0.05em;
            }
          }

          // 为不同卡片添加微妙的颜色差异
          &:nth-child(1) {
            .overview-icon {
              color: #3b82f6;
            }
            &:hover .overview-icon {
              color: #2563eb;
            }
          }

          &:nth-child(2) {
            .overview-icon {
              color: #8b5cf6;
            }
            &:hover .overview-icon {
              color: #7c3aed;
            }
          }

          &:nth-child(3) {
            .overview-icon {
              color: #06b6d4;
            }
            &:hover .overview-icon {
              color: #0891b2;
            }
          }

          &:nth-child(4) {
            .overview-icon {
              color: #10b981;
            }
            &:hover .overview-icon {
              color: #059669;
            }
          }

          &:nth-child(5) {
            .overview-icon {
              color: #f59e0b;
            }
            &:hover .overview-icon {
              color: #d97706;
            }
          }

          &:nth-child(6) {
            .overview-icon {
              color: #ef4444;
            }
            &:hover .overview-icon {
              color: #dc2626;
            }
          }
        }
      }
    }

    .info-section {
      display: flex;
      flex-direction: column;
      gap: 1rem;

      .info-card {
        background: rgba(255, 255, 255, 0.7);
        border: 1px solid rgba(226, 232, 240, 0.6);
        border-radius: 8px;
        padding: 1.2rem;
        transition: all 0.2s ease;

        &:hover {
          background: rgba(255, 255, 255, 0.9);
          border-color: rgba(59, 130, 246, 0.3);
          box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.1);
        }

        .info-title {
          font-size: 0.9rem;
          font-weight: 600;
          color: #1e293b;
          margin-bottom: 1rem;
          display: flex;
          align-items: center;
          gap: 0.5rem;

          i {
            color: #3b82f6;
            font-size: 0.8rem;
          }
        }

        // 快速导航样式
        &.quick-nav {
          .nav-links {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 0.8rem;

            .nav-link {
              display: flex;
              align-items: center;
              gap: 0.5rem;
              padding: 0.6rem 0.8rem;
              background: rgba(59, 130, 246, 0.05);
              border-radius: 6px;
              text-decoration: none;
              color: #374151;
              font-size: 0.8rem;
              font-weight: 500;
              transition: all 0.2s ease;

              &:hover {
                background: rgba(59, 130, 246, 0.1);
                color: #3b82f6;
                transform: translateX(2px);
              }

              i {
                font-size: 0.7rem;
                color: #6b7280;
              }

              &:hover i {
                color: #3b82f6;
              }
            }
          }
        }

        // 热门标签样式
        &.hot-tags {
          .tags-container {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;

            .tag {
              padding: 0.3rem 0.6rem;
              background: rgba(59, 130, 246, 0.1);
              color: #3b82f6;
              border-radius: 12px;
              font-size: 0.7rem;
              font-weight: 500;
              transition: all 0.2s ease;

              &:hover {
                background: rgba(59, 130, 246, 0.2);
                transform: translateY(-1px);
              }
            }
          }
        }

        // 网站状态样式
        &.site-status {
          .status-items {
            display: flex;
            flex-direction: column;
            gap: 0.8rem;

            .status-item {
              display: flex;
              justify-content: space-between;
              align-items: center;
              padding: 0.5rem 0;
              border-bottom: 1px solid rgba(226, 232, 240, 0.5);

              &:last-child {
                border-bottom: none;
              }

              .status-label {
                font-size: 0.8rem;
                color: #6b7280;
                font-weight: 500;
              }

              .status-value {
                font-size: 0.8rem;
                color: #1e293b;
                font-weight: 600;

                &.online {
                  color: #10b981;
                  font-size: 0.6rem;
                }
              }
            }
          }
        }
      }
    }
  }

  .feature-section,
  .tech-stack {
    background: white;
    border-radius: 20px;
    padding: 4rem 2rem;
    margin: 2rem auto;
    max-width: 1200px;

    h2 {
      text-align: center;
      margin-bottom: 3rem;
      font-size: 2.5rem;
      color: #2c3e50;
    }

    .feature-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
      gap: 2rem;

      .feature-card {
        text-align: center;
        padding: 2rem 1.5rem;
        border-radius: 15px;
        background: #f8f9fa;
        transition: all 0.3s ease;

        &:hover {
          transform: translateY(-5px);
          box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
          background: white;
        }

        .feature-icon {
          font-size: 3rem;
          color: #667eea;
          margin-bottom: 1.5rem;
        }

        h3 {
          font-size: 1.3rem;
          color: #2c3e50;
          margin-bottom: 1rem;
        }

        p {
          color: #666;
          line-height: 1.6;
          font-size: 0.95rem;
        }
      }
    }
  }

  .site-footer {
    position: relative;
    z-index: 2;
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 4rem 2rem 1rem;
    margin-top: 4rem;

    .footer-content {
      max-width: 1200px;
      margin: 0 auto;
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 3rem;
      margin-bottom: 3rem;

      @media (max-width: 768px) {
        grid-template-columns: 1fr;
        gap: 2rem;
      }
    }

    .footer-section {
      h3 {
        color: #fff;
        font-size: 1.2rem;
        margin-bottom: 1.5rem;
        position: relative;

        &:after {
          content: '';
          position: absolute;
          left: 0;
          bottom: -0.5rem;
          width: 50px;
          height: 2px;
          background-color: #3498db;
        }
      }
    }

    .footer-description {
      color: #bdc3c7;
      line-height: 1.6;
      margin-bottom: 1.5rem;
    }

    .footer-social {
      display: flex;
      gap: 1rem;

      .social-icon {
        color: #ecf0f1;
        font-size: 1.2rem;
        transition: color 0.3s;

        &:hover {
          color: #3498db;
        }
      }
    }

    .footer-links {
      list-style: none;
      padding: 0;

      li {
        margin-bottom: 0.8rem;

        a {
          color: #bdc3c7;
          text-decoration: none;
          transition: color 0.3s;
          display: inline-block;

          &:hover {
            color: #3498db;
            transform: translateX(5px);
          }
        }
      }
    }

    .contact-info {
      list-style: none;
      padding: 0;

      li {
        margin-bottom: 1rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;

        i {
          color: #3498db;
        }

        a {
          color: #bdc3c7;
          text-decoration: none;
          transition: color 0.3s;

          &:hover {
            color: #3498db;
          }
        }
      }
    }
  }
}

@keyframes titleFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shine {
  0% {
    background-position: 200% center;
  }
  100% {
    background-position: -200% center;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@media (max-width: 1024px) and (min-width: 769px) {
  .website-overview {
    .stats-section {
      .overview-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
      }
    }
  }
}

@media (max-width: 768px) {
  .home-container {
    .hero-section {
      h1 {
        font-size: 2.5rem;
      }

      .subtitle {
        font-size: 1.2rem;
      }
    }

    .website-overview {
      padding: 1.5rem 1rem;
      border-radius: 8px;

      .overview-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
      }

      .stats-section {
        .section-title {
          font-size: 1.1rem;
          margin-bottom: 1rem;
        }

        .overview-grid {
          grid-template-columns: repeat(2, 1fr);
          gap: 0.8rem;

          .overview-card {
            padding: 1rem 0.6rem;
            border-radius: 6px;

            .overview-icon {
              font-size: 1.5rem;
              margin-bottom: 0.6rem;
            }

            .overview-content {
              h3 {
                font-size: 1.2rem;
                margin-bottom: 0.2rem;
              }

              p {
                font-size: 0.7rem;
              }
            }
          }
        }
      }

      .info-section {
        gap: 0.8rem;

        .info-card {
          padding: 1rem;

          .info-title {
            font-size: 0.85rem;
            margin-bottom: 0.8rem;
          }

          &.quick-nav {
            .nav-links {
              grid-template-columns: 1fr;
              gap: 0.6rem;

              .nav-link {
                padding: 0.5rem 0.6rem;
                font-size: 0.75rem;
              }
            }
          }

          &.hot-tags {
            .tags-container {
              gap: 0.4rem;

              .tag {
                padding: 0.25rem 0.5rem;
                font-size: 0.65rem;
              }
            }
          }

          &.site-status {
            .status-items {
              gap: 0.6rem;

              .status-item {
                padding: 0.4rem 0;

                .status-label {
                  font-size: 0.75rem;
                }

                .status-value {
                  font-size: 0.75rem;

                  &.online {
                    font-size: 0.55rem;
                  }
                }
              }
            }
          }
        }
      }
    }

    .feature-section,
    .tech-stack,
    .popular-posts {
      padding: 2rem 1rem;

      h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
      }

      .feature-grid,
      .tech-grid,
      .popular-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;

        .feature-card,
        .tech-card,
        .popular-card {
          padding: 1.5rem 1rem;

          .feature-icon {
            font-size: 2.5rem;
          }

          h3 {
            font-size: 1.2rem;
          }

          img {
            width: 60px;
            height: 60px;
          }
        }

        .popular-card {
          flex-direction: column;
          text-align: center;

          .post-rank {
            margin-right: 0;
            margin-bottom: 1rem;
          }

          .post-info {
            h3 {
              font-size: 1.1rem;
            }

            .post-stats {
              justify-content: center;
              flex-wrap: wrap;
            }
          }
        }
      }
    }
  }
}
</style>
